% robust parzen averaging
% not tested and stamped
% latest date 25.5.3

function[C] = rbpz(C1,C2),

S = C1.*conj(C2);
sig_m = 1.483*median(abs(S-median(S))); % median absolute deviation 
c_m = 1.5*sig_m;
k = find(abs(S) <= c_m);					% assigning Huber weights 
w_m(k) = 1;
q = find(abs(S) > c_m);
w_m(q) = c_m./abs(S(q));
C = sum(S.*w_m)/length(C1);  
